package com.example.makerspace.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.TechnicDockingDO;
import com.example.makerspace.mapper.TechnicDockingMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;

@Component
public class TechnicDockingDAO extends BaseDAO<TechnicDockingDO> {
    @Resource
    private TechnicDockingMapper technicDockingMapper;

    @PostConstruct
    public void init(){
        this.mapper = technicDockingMapper;
    }

    public final static String TECHNIC_NAME = "technic_name";

    public TechnicDockingDO selectByTechnicName(String technicName){
        return technicDockingMapper.selectOne(new QueryWrapper<TechnicDockingDO>().eq(TECHNIC_NAME, technicName));
    }

    public List<TechnicDockingDO> selectByIds(List<Integer> ids) {
        return technicDockingMapper.selectBatchIds(ids);
    }
}
